libxl: remove code in stubdom creation failure path and callback
authorWei Liu <wei.liu2@citrix.com>
Mon, 1 Jun 2015 17:24:35 +0000 (18:24 +0100)
committerIan Campbell <ian.campbell@citrix.com>
Wed, 3 Jun 2015 10:12:03 +0000 (11:12 +0100)
commite8ebc71c68dabc8e4db3a702d56deda657405653
tree094ad1ce95f2444ad1993a1bfe30d4b57d68326d
parent8d90cbb135bd1407788df4deb721edc2a124c6ac
libxl: remove code in stubdom creation failure path and callback

The snippet to destroy stubdom and the callback were added in 1fc3aeb3
("libxl: use new QEMU xenstore protocol"). The intention was to destroy
stubdom when it is not responsive. That approach is problematic because
rc is not propagate back to sdss->callback, hence the guest is leaked.

The solution is simple. The destruction of stubdom can be done later in
sdss->callback. That code path already does the right thing to destroy
both the guest and the stubdom that serves the guest.

Signed-off-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_dm.c